<?php

namespace App\Http\Controllers;

use App\Library\Requests\Base\SerialNumberRequest;
use App\Library\Requests\Base\SerialNumbersRequest;
use App\Library\Requests\SourceMaterial\SourceMaterialAddRequest;
use App\Library\Requests\SourceMaterial\SourceMaterialPagingRequest;
use App\Library\Requests\SourceMaterial\SourceMaterialSubmitRecordPageRequest;
use App\Library\Service\SourceMaterialService;
use Illuminate\Http\JsonResponse;
use Illuminate\Http\Request;

class SourceMaterialController extends BaseController
{
    public function __construct(SourceMaterialService $service)
    {
        $this->service = $service;
    }

    /**
     * 提交素材
     * @param SourceMaterialAddRequest $request
     * @return JsonResponse
     *
     */
    public function add(SourceMaterialAddRequest $request): JsonResponse
    {
        return $this->service->add($request);
    }

    /**
     *
     * @param SourceMaterialPagingRequest $request
     * @return JsonResponse
     *
     */
    public function paging(SourceMaterialPagingRequest $request): JsonResponse
    {
        return $this->service->paging($request);
    }

    /**
     *
     * @param SerialNumberRequest $request
     * @return JsonResponse
     *
     */
    public function detail(SerialNumberRequest $request): JsonResponse
    {
        return $this->service->detail($request);
    }
    /**
     * 提交记录
     * @param SourceMaterialSubmitRecordPageRequest $request
     * @return JsonResponse
     *
     */
    public function submitRecordPaging(SourceMaterialSubmitRecordPageRequest $request): JsonResponse
    {
        return $this->service->submitRecordPaging($request);
    }

    /**
     * 删除记录
     * @param SerialNumbersRequest $request
     * @return JsonResponse
     *
     */
    public function submitRecordDelete(SerialNumbersRequest $request): JsonResponse
    {
        return $this->service->submitRecordDelete($request);
    }
}
